while True : x= int ( input ( "enter a number:" )) bool_val= input ( "enter 1 or 0:" ) if bool_val== '1' : for i in range ( 0 ,x+ 1 ): print ( "*" *i) if bool_val== '0' : for j in range (x, 0 ,- 1 ): print ( "*" *j) Exit= input ( ''' Do you want to pattern print again type Y for (yes) and type N for (no): ''' ) if Exit== 'n' : print ( "Good Bye!!" ) break
Comments
Post a Comment